#pragma once

#include "GlobalDefines.h"

class WSApplication : public WSObject
{
public:
	WSApplication();
	virtual ~WSApplication();

public:
	int run();

	HWND GetWndHandle() { return mWndHandle; }

	std::string GetPath(const char *fmt, ...);

public:
	virtual void Initialize();
	virtual void Destroy();

	virtual void render() = 0;

	virtual LRESULT CALLBACK msg_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { return 1; }
	static LRESULT CALLBACK window_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

private:
	bool create_app_window(const char *title, int w, int h, bool full_screen);
	void init_opengl();

protected:
	bool mIsFullscreen;

	HWND mWndHandle;
	HDC mDCHandle;

	int mWidth;
	int mHeight;

	std::string mEXEFolder;

	DWORD mCurrentTime;
	DWORD mLastTime;
	DWORD mFramesPerSecond;

	//WSCameraSimple mCamera;
};